From: Jasper St. Pierre Date: Fri, 24 Aug 2012 01:37:50 +0000 (-0300) Subject: shellDBus: Fix reloadExtension X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6057 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4ca26972714e9750bcf38fd47ac841aaba6cb714;p=gnome-shell.git shellDBus: Fix reloadExtension We need to recreate and reimport the extension here, not just reimport the same exact code. https://bugzilla.gnome.org/show_bug.cgi?id=682578 --- diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index ac4acbb73..4eb49c10f 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -171,6 +171,19 @@ function unloadExtension(extension) { return true; } +function reloadExtension(oldExtension) { + // Grab the things we'll need to pass to createExtensionObject + // to reload it. + let { uuid: uuid, dir: dir, type: type } = oldExtension; + + // Then unload the old extension. + unloadExtension(oldExtension); + + // Now, recreate the extension and load it. + let newExtension = ExtensionUtils.createExtensionObject(uuid, dir, type); + loadExtension(newExtension); +} + function initExtension(uuid) { let extension = ExtensionUtils.extensions[uuid]; let dir = extension.dir; diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js index 53a6523c2..78aebab16 100644 --- a/js/ui/shellDBus.js +++ b/js/ui/shellDBus.js @@ -318,8 +318,11 @@ const GnomeShellExtensions = new Lang.Class({ }, ReloadExtension: function(uuid) { - ExtensionSystem.unloadExtension(uuid); - ExtensionSystem.loadExtension(uuid); + let extension = ExtensionUtils.extensions[uuid]; + if (!extension) + return; + + ExtensionSystem.reloadExtension(extension); }, CheckForUpdates: function() {